<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="title">
            <h2><a href="#" class="back" onclick="history.go(-1)"/>Visualizar Usuário</h2>
        </ui:define>

        <ui:define name="body">
            <p:panel styleClass="container_24 clearfix">
                <div class="buttonAction" style="float: right">
                    <p:button value="Editar" href="editarusuario.xhtml?usuEd=#{managerPesquisarUsuario.usuarioVisualizar.id}"
                              icon="ui-icon-pencil" styleClass="ui-priority-primary"/>
                </div>
            </p:panel>
            
            <h:form id="clienteForm" enctype="multipart/form-data">            
                <p:messages id="messages" closable="true" showDetail="true" autoUpdate="true"  />
                <p:panel id="dadosGeraisPanel" styleClass="container_24 clearfix">
                    <h2><a href="#">Dados Gerais</a></h2>
                    <br/>
                    <p:outputLabel value="Nome:" styleClass="grid_3"/>
                    <p:inputText  styleClass="grid_18" readonly="true" 
                                  value="#{managerPesquisarUsuario.usuarioVisualizar.nome}"/>
                    <div class="clear"/>
                    <p:outputLabel value="Contato:" styleClass="grid_3" for="telInputText"/>
                    <p:inputMask  id="telInputText" readonly="true" mask="(99)9999-9999" 
                                  styleClass="grid_5" value="#{managerPesquisarUsuario.usuarioVisualizar.telefone}"/>
                    <!--                        <div class="clear"/>-->
                    <p:outputLabel value="Email:" styleClass="grid_2 alpha" for="emailInputText"/>
                    <p:inputText id="emailInputText" readonly="true" styleClass="grid_11" 
                                 value="#{managerPesquisarUsuario.usuarioVisualizar.email}"/>

                </p:panel> 

                <p:panel id="setorPanel" styleClass="container_24 clearfix">
                    <h2><a href="#">Setor</a></h2>
                    <br/>
                    <p:outputLabel value="Setor : " styleClass="grid_3"/>
                    <p:inputText styleClass="grid_18" value="#{managerPesquisarUsuario.setorVisualizar.nome}" readonly="true"/>

                </p:panel>

                <p:panel id="adminPanel" styleClass="container_24 clearfix">
                    <h2><a href="#">Administração</a></h2>
                    <br/> 

                    <p:dataTable id="tableAdmin" var="item" value="#{managerPesquisarUsuario.gruposVisualizar}" 
                                 styleClass="grid_24" rowIndexVar="rowid" 
                                 style="white-space: pre-wrap;"
                                 rowKey="#{item.id}" rows="5" paginator="true"  
                                 paginatorPosition="bottom" emptyMessage="Nenhum registro">  
                        <f:facet name="header">
                            <p:outputLabel value="Nível de Acesso" />
                        </f:facet>

                        <p:column headerText="Permissão"> 
                            <p:outputLabel value="#{item.descricao}"/>
                        </p:column>

                    </p:dataTable>

                </p:panel>  
                <br/>
                <div class="buttonAction">

                    <p:button value="Voltar" icon="ui-icon-circle-arrow-w"
                              href="pesquisarusuario.xhtml" />
                </div>
            </h:form>

        </ui:define>
    </ui:composition>
</html>



